import * as Utils from '@/utils/index'
const topNav = [
  { id: 1, name: '运力管理' }
  // { id: 2, name: '车队管理' },
  // { id: 4, name: '价格管理' },
  // { id: 5, name: '结算管理' },
  // { id: 6, name: '质量考核' },
  // { id: 3, name: '系统设置' },
  // { id: 7, name: '第一桶油充值' }
]

const permissionRouter = [
  // 运力登记
  { id: 1, code: '/vendor/regist/lsp', name: '运力登记', meta: { title: '运力登记', icon: 'table' }},
  { id: 1, code: '/vendor/regist/lsp', name: '承运商登记', meta: { title: '承运商登记', icon: 'table' }},
  { id: 1, code: '/vendor/regist/driver', name: '司机登记', meta: { title: '司机登记', icon: 'table' }},
  { id: 1, code: '/vendor/regist/carrier', name: '牵引车登记', meta: { title: '牵引车登记', icon: 'table' }},
  { id: 1, code: '/vendor/regist/trailer', name: '挂车登记', meta: { title: '挂车登记', icon: 'table' }},
  // 运力认证
  { id: 1, code: '/vendor/authenticate', name: '运力认证', meta: { title: '运力认证', icon: 'table' }},
  // 认证运力管理
  { id: 1, code: '/vendor/mgmt', name: '认证运力管理', meta: { title: '认证运力管理', icon: 'table' }},
  { id: 1, code: '/vendor/mgmt/driverBind', name: '司机车辆绑定', meta: { title: '司机车辆绑定', icon: 'table' }},
  { id: 1, code: '/vendor/mgmt/vehicleBind', name: '牵引车挂车绑定', meta: { title: '牵引车挂车绑定', icon: 'table' }},
  { id: 1, code: '/vendor/mgmt/advancedSettings', name: '高级设置', meta: { title: '高级设置', icon: 'table' }},
  //
  // { id: 1, code: '/vendor/archive', name: '运力档案库', meta: { title: '运力档案库', icon: 'table' }},
  // 运力报班管理
  { id: 1, code: '/vendor/checkin', name: '运力报班管理', meta: { title: '运力报班管理', icon: 'table' }},
  { id: 1, code: '/vendor/checkin/config', name: '报班记录管理', meta: { title: '报班记录管理', icon: 'table' }},
  { id: 1, code: '/vendor/checkin/cancel', name: '取消报班审核', meta: { title: '取消报班审核', icon: 'table' }},
  { id: 1, code: '/vendor/checkin/vehicleCheckIn', name: '车辆报班管理', meta: { title: '车辆报班管理', icon: 'table' }},
  // 公众号报表
  { id: 1, code: '/vendor/report', name: '公众号报表', meta: { title: '公众号报表', icon: 'table' }},
  { id: 1, code: '/vendor/report/WeChatSubscriptionUsage', name: '公众号使用情况报表', meta: { title: '公众号使用情况报表', icon: 'table' }},
  { id: 1, code: '/vendor/report/wechatUsageRate', name: '公众号使用率报表', meta: { title: '公众号使用率报表', icon: 'table' }},
  // 照片管理
  { id: 1, code: '/vendor/picture', name: '照片管理', meta: { title: '照片管理', icon: 'table' }},
  { id: 1, code: '/vendor/picture/loadPictureExamine', name: '装车照片审核', meta: { title: '装车照片审核', icon: 'table' }},
  // 份额设置
  // { id: 1, code: '/vendor/quota', name: '份额设置', meta: { title: '份额设置', icon: 'table' }},
  // { id: 1, code: '/vendor/quota/config', name: '份额设置', meta: { title: '份额设置', icon: 'table' }},
  // { id: 1, code: '/vendor/quota/statistics', name: '份额完成统计', meta: { title: '份额完成统计', icon: 'table' }},
  // 车队管理
  { id: 2, code: '/fleet/config', name: '车队管理', meta: { title: '车队管理', icon: 'table' }},
  // { id: 2, code: '/fleet/config/index', name: '车队设置', meta: { title: '车队设置', icon: 'table' }},
  { id: 2, code: '/fleet/config/fleetLspConfig', name: '承运商车队设置', meta: { title: '承运商车队设置', icon: 'table' }},
  { id: 2, code: '/fleet/config/fleetCompanyConfig', name: '公司车队设置', meta: { title: '公司车队设置', icon: 'table' }},
  { id: 2, code: '/fleet/config/fleetAdminConfig', name: '车队管理员配置', meta: { title: '车队管理员配置', icon: 'table' }},
  { id: 2, code: '/fleet/config/fleetVehicleConfig', name: '车队车辆管理', meta: { title: '车队车辆管理', icon: 'table' }},
  { id: 2, code: '/fleet/config/fleetCheckInLog', name: '车队报班记录', meta: { title: '车队报班记录', icon: 'table' }},
  // 公司信息
  { id: 3, code: '/appsetting/conpanyProfile/index', name: '公司信息', meta: { title: '公司信息', icon: 'table' }},
  // 管理员配置
  { id: 3, code: '/appsetting/adminConfig', name: '管理员配置', meta: { title: '管理员配置', icon: 'table' }},
  // 账号管理
  { id: 3, code: '/appsetting/account', name: '账号管理', meta: { title: '账号管理', icon: 'table' }},
  { id: 3, code: '/appsetting/account/setupLsp', name: '开通承运商账号', meta: { title: '开通承运商账号', icon: 'table' }},
  { id: 3, code: '/appsetting/account/setupDriver', name: '开通司机账号', meta: { title: '开通司机账号', icon: 'table' }},
  { id: 3, code: '/appsetting/account/resetPassword', name: '重置账号密码', meta: { title: '重置账号密码', icon: 'table' }},
  { id: 3, code: '/appsetting/account/updatePassword', name: '修改密码', meta: { title: '修改密码', icon: 'table' }},
  { id: 3, code: '/appsetting/account/role', name: '角色管理', meta: { title: '角色管理', icon: 'table' }},
  { id: 3, code: '/appsetting/account/user', name: '用户管理', meta: { title: '用户管理', icon: 'table' }},
  // 运距测算
  { id: 3, code: '/appsetting/utils/rangeCalculate', name: '运距测算', meta: { title: '运距测算', icon: 'table' }},
  // 价格管理
  { id: 4, code: '/price/setupIncome', name: '订单收入价格', meta: { title: '订单收入价格', icon: 'table' }},
  { id: 4, code: '/price/setupOrderPay', name: '订单支出价格', meta: { title: '订单支出价格', icon: 'table' }},
  // 价格参数设置
  { id: 4, code: '/price/priceParams/', name: '价格参数设置', meta: { title: '价格参数设置', icon: 'table' }},
  { id: 4, code: '/price/priceParams/setupPayPoint', name: '支付扣点设置', meta: { title: '支付扣点设置', icon: 'table' }},
  { id: 4, code: '/price/priceParams/setupPayRatio', name: '支付系数设置', meta: { title: '支付系数设置', icon: 'table' }},
  // 人送
  { id: 4, code: '/price/sendByDriverConfig', name: '人送价格设置', meta: { title: '人送价格设置', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/line', name: '线路', meta: { title: '线路', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/vehicle', name: '车型维护', meta: { title: '车型维护', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/fuel', name: '基础燃油类型', meta: { title: '基础燃油类型', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/volume', name: '车型油箱容积', meta: { title: '车型油箱容积', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/release', name: '车型油耗发布', meta: { title: '车型油耗发布', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/rel', name: '支付里程发布', meta: { title: '支付里程发布', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/relea', name: '运价发布', meta: { title: '运价发布', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/posted', name: '油价发布', meta: { title: '油价发布', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverConfig/pertrol', name: '加油站油价发布', meta: { title: '加油站油价发布', icon: 'table' }},
  // 应收账单
  { id: 5, code: '/balance/receivableBill', name: '应收账单', meta: { title: '应收账单', icon: 'table' }},
  { id: 5, code: '/balance/receivableBill/customerBillMgt', name: '客户账单', meta: { title: '客户账单', icon: 'table' }},
  { id: 5, code: '/balance/receivableBill/customerBillReceivableOut', name: '应收出账', meta: { title: '应收出账', icon: 'table' }},
  { id: 5, code: '/balance/receivableBill/customerBillReceivableContrast', name: '应收对账', meta: { title: '应收对账', icon: 'table' }},
  // 应付账单
  { id: 5, code: '/balance/payableBill', name: '应付账单', meta: { title: '应付账单', icon: 'table' }},
  { id: 5, code: '/balance/payableBill/carrierBillMgt', name: '承运商账单', meta: { title: '承运商账单', icon: 'table' }},
  { id: 5, code: '/balance/payableBill/oilPreBill', name: '油卡预付账单', meta: { title: '油卡预付账单', icon: 'table' }},
  { id: 5, code: '/balance/payableBill/cashPreBill', name: '现金预付账单', meta: { title: '现金预付账单', icon: 'table' }},
  { id: 5, code: '/balance/payableBill/otherBill', name: '其他费用款项', meta: { title: '其他费用款项', icon: 'table' }},
  { id: 5, code: '/balance/payableBill/carrierBillPayableOut', name: '应付出账', meta: { title: '应付出账', icon: 'table' }},
  { id: 5, code: '/balance/payableBill/carrierBillPayableContrast', name: '应付对账', meta: { title: '应付对账', icon: 'table' }},
  { id: 5, code: '/balance/payableBill/chargeOff', name: '出账规则', meta: { title: '出账规则', icon: 'table' }},
  // 应收应付查询
  { id: 5, code: '/balance/receivablePayable', name: '应收应付查询', meta: { title: '应收应付查询', icon: 'table' }},
  { id: 5, code: '/balance/receivablePayable/receivableAccounts', name: '应收账款查询', meta: { title: '应收账款查询', icon: 'table' }},
  { id: 5, code: '/balance/receivablePayable/payableAccounts', name: '应付账款查询', meta: { title: '应付账款查询', icon: 'table' }},
  // 开票管理
  { id: 5, code: '/balance/invoice', name: '开票管理', meta: { title: '开票管理', icon: 'table' }},
  { id: 5, code: '/balance/invoice/openInvoice', name: '开票申请审核', meta: { title: '开票申请审核', icon: 'table' }},
  { id: 5, code: '/balance/invoice/invoiceRegist', name: '发票登记', meta: { title: '发票登记', icon: 'table' }},
  // 收款管理
  { id: 5, code: '/balance/receipt/receiptConfirm', name: '收款管理', meta: { title: '收款管理', icon: 'table' }},
  // 付款管理
  { id: 5, code: '/balance/payment', name: '付款管理', meta: { title: '付款管理', icon: 'table' }},
  { id: 5, code: '/balance/payment/paymentApply', name: '支付申请', meta: { title: '支付申请', icon: 'table' }},
  { id: 5, code: '/balance/payment/paymentApplyReview', name: '支付申请审核', meta: { title: '支付申请审核', icon: 'table' }},
  { id: 5, code: '/balance/payment/paymentConfirm', name: '排款申请', meta: { title: '排款申请', icon: 'table' }},
  { id: 5, code: '/balance/payment/capitalArrangement', name: '付款确认', meta: { title: '付款确认', icon: 'table' }},
  // 合同管理
  { id: 5, code: '/balance/contract/contractList', name: '合同列表', meta: { title: '合同列表', icon: 'table' }},
  { id: 5, code: '/balance/contract/offerBill', name: '报价单管理', meta: { title: '报价单管理', icon: 'table' }},
  { id: 5, code: '/balance/contract/quoteWaitConfirmList', name: '报价单审核列表', meta: { title: '合同审核列表', icon: 'table' }},
  // 考核结果管理
  { id: 6, code: '/quality/assessResult', name: '考核结果管理', meta: { title: '考核结果管理', icon: 'table' }},
  // 第一桶油充值
  { id: 7, code: '/pertrolOil/oil/pertrolOilPriceConfirm', name: '充值确认', meta: { title: '充值确认', icon: 'table' }},
  { id: 7, code: '/pertrolOil/oil/pertrolOilPriceQuery', name: '充值查询', meta: { title: '充值查询', icon: 'table' }},
  { id: 7, code: '/pertrolOil/oil/pertrolOilPriceConfirmQuery', name: '充值确认查询', meta: { title: '充值确认查询', icon: 'table' }},
  // 人送供方价格设置
  { id: 4, code: '/price/sendByDriverLsp/sdAToBSupplierMgt', name: 'A-B人送供方设置', meta: { title: 'A-B人送供方设置', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverLsp/baseDataInfoMgt', name: '基础信息维护', meta: { title: '基础信息维护', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverLsp/traditionPriceMgt', name: '传统价格管理', meta: { title: '传统价格管理', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverLsp/fixedPriceMgt', name: '一口价管理', meta: { title: '一口价管理', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverLsp/marketOilPriceMgt', name: '市场油价管理', meta: { title: '市场油价管理', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverLsp/priceRateMgt', name: '价格比例设置', meta: { title: '价格比例设置', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverLsp/vehicleContrastMgt', name: '车型对照管理', meta: { title: '车型对照管理', icon: 'table' }},
  { id: 4, code: '/price/sendByDriverLsp/otherExpensesMgt', name: '其他费用管理', meta: { title: '其他费用管理', icon: 'table' }}
]
export default {
  getTopNavs: () => {
    return {
      code: 0,
      message: '获取头路由成功-mock',
      data: topNav
    }
  },
  getSideNavs: (req) => {
    console.log('getSideNavs()-req', req)
    const req_params = Utils.urlParse(req.url)
    console.log('getSideNavs()-req_params', req_params)
    const pid = req_params.pid
    if (parseInt(pid) === 0) {
      return {
        code: 0,
        message: '获取侧边栏数据成功-mock',
        data: permissionRouter.map(i => i)
      }
    }
    let temp = permissionRouter.filter(i => {
      if (i.id === parseInt(pid)) {
        return true
      } else {
        return false
      }
    })
    temp = temp.map(i => {
      return i
    })
    return {
      code: 0,
      message: '获取侧边栏数据成功-mock',
      data: temp
    }
  }
}
